{% extends "base.html" %}

{% block title %}
    {% if is_home %}
        博客小站
    {% endif %}
    {% if is_arch_month %}
        {{ month }}月|{{ year }}年||博客小站
    {% endif %}
    {% if is_classfi %}
        {{ classfi }}|博客小站
    {% endif %}
    {% if is_tag %}
        {{ tag }} |博客小站
    {% endif %}
{% endblock %}
{% block path %}

    {% if is_home %}
        <li >当前位置</li>
        <li class="active"><a href="{% url 'home' %}">首页</a></li>
    {% endif %}
    {% if is_arch_month %}
         <li ><a href="{% url 'home' %}">首页</a> </li>
         <li class="active">按月归档：{{ month }}月{{ year }}年</li>
    {% endif %}

    {% if is_classfi %}
         <li ><a href="{% url 'home' %}">首页</a> </li>
         <li class="active">文章分类：{{ classfi }}</li>
    {% endif %}
    {% if is_tag %}
         <li ><a href="{% url 'home' %}">首页</a> </li>
         <li class="active">标签归档：{{ tag }}</li>
    {% endif %}
    {% if is_arch_search %}
        <li ><a href="{% url 'home' %}">首页</a> </li>
         <li class="active">搜索结果：{{ s }} {{ tag }}</li>
    {% endif %}

{% endblock %}
<!--广告条-->
{% block header %}
{% include "blog/_header.html" %}
{% endblock %}

{% block content %}
    {% if error %}
    <h2>没有相关文章题目</h2>
    {% else %}
    {% for article in articles %}
        <div class="article">
        <div class="article-bg"></div>
        <div class="panel panel-default " >
        <div class="panel-heading">
            <h3 class="panel-title"><a href="{{ article.get_absolute_url }}" rel="bookmark">{{ article.title }}</a></h3>
            <section class="info">
                <time datetime="{{ article.publish_time.year }}-{{ article.publish_time.month }}-{{ article.publish_time.day }}">{{ article.publish_time.year }}年{{ article.publish_time.month }}月{{ article.publish_time.day }}日</time>
                <span><a href="{% url "classfiDetail" classfi=article.classification %}" class="pull-right">{{ article.classification }}</a></span>
            </section>
        </div>
        <div class="panel-body">
            {{ article.content|truncatewords_html:40|safe }}
        </div>
            <div class="panel-footer">
                {% for i in article.get_tags %}
                    <a href="{{ i.get_absolute_url }}" rel="tag">{{ i }}</a>
                {% endfor %}
                <a href="{{ article.get_absolute_url }}" class="pull-right"><span class="glyphicon glyphicon-link" aria-hidden="true"></span>阅读全文</a>
            </div>
        </div>
        </div>

    {% endfor %}
    {% endif %}
    {% include "blog/_paginator.html" %}
{% endblock %}